package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;


@Table(name = "ALIPAY")
public class ALIPAY extends Model {

	@Column(name = "alipay_partner")
	public String alipay_partner;

	@Column(name = "alipay_account")
	public String alipay_account;

	@Column(name = "alipay_key")
	public String alipay_key;

	@Column(name = "alipay_pay_private")
	public String alipay_pay_private;

	@Column(name = "alipay_pay_public")
	public String alipay_pay_public;
	
	@Column(name = "alipay_notify_url")
	public String alipay_notify_url;
	
	public static ALIPAY fromJson(JSONObject jsonObject) throws JSONException {
		if (null == jsonObject) {
			return null;
		}

		ALIPAY localItem = new ALIPAY();
		
		localItem.alipay_partner = jsonObject.optString("alipay_partner");
		localItem.alipay_account = jsonObject.optString("alipay_account");
		localItem.alipay_key = jsonObject.optString("alipay_key");
		localItem.alipay_pay_private = jsonObject.optString("alipay_pay_private");
		localItem.alipay_pay_public = jsonObject.optString("alipay_pay_public");
		localItem.alipay_notify_url = jsonObject.optString("alipay_notify_url");

		return localItem;
	}

}